'use strict';
const crypto = require("crypto");
module.exports = app => {
    const { STRING, INTEGER, DATE, ENUM, TEXT, BOOLEAN } = app.Sequelize;
    // 配置（重要：一定要配置详细，一定要！！！）
    const Menus = app.model.define('menus',  {
      id: {
        type: INTEGER(20),
        primaryKey: true,
        autoIncrement: true
      },
      menuname: {
        type: STRING(30),
        allowNull: false,
        defaultValue: '',
        comment: '菜单名',
        unique: true
      },
      menupath: {
        type: STRING(160),
        allowNull: false,
        defaultValue: '',
        comment: '菜单路径',
      },
      icon: {
        type: STRING(30),
        allowNull: false,
        defaultValue: '',
        comment: '图标'
      },
      fatherpath: {
        type: STRING(160),
        allowNull: false,
        defaultValue: '',
        comment: '父路径'
      },
      sortnum: {
        type: STRING(30),
        allowNull: false,
        defaultValue: '',
        comment: '排序'
      },
      haschildren: {
        type: BOOLEAN,
        allowNull: false,
        defaultValue: '',
        comment: '是否有子节点'
      },
      created_time: DATE,
      updated_time: DATE,
      deleted_time: DATE
    });
    return Menus;
};